<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('nfts', function (Blueprint $table) {
            $table->comment('NFT');
            $table->id();
            $table->unsignedInteger('user_id')->default(0)->comment('用户ID');
            $table->string('nft_id')->unique()->nullable()->comment('NFT ID');
            $table->string('name')->comment('NFT名称');
            $table->string('symbol')->comment('NFT符号');
            $table->string('description')->comment('NFT描述');
            $table->string('img')->comment('图片');
            $table->string('background')->comment('背景');
            $table->unsignedDecimal('background_percent',20,8)->default(0)->comment('background稀有度');
            $table->string('core')->comment('core');
            $table->unsignedDecimal('core_percent',20,8)->default(0)->comment('core稀有度');
            $table->string('gear')->comment('gear');
            $table->unsignedDecimal('gear_percent',20,8)->default(0)->comment('gear稀有度');
            $table->string('hat')->comment('hat');
            $table->unsignedDecimal('hat_percent',20,8)->default(0)->comment('hat稀有度');
            $table->string('traits')->comment('traits');
            $table->unsignedDecimal('traits_percent',20,8)->default(0)->comment('traits稀有度');
            $table->string('earring')->comment('earring');
            $table->unsignedDecimal('earring_percent',20,8)->default(0)->comment('earring稀有度');
            $table->unsignedDecimal('percent',20,8)->default(0)->comment('earring稀有度');
            $table->unsignedDecimal('power',20,8)->comment('算力');
            $table->unsignedDecimal('minted_amount',20,8)->default(0)->comment('累计产出doge数量');
            $table->unsignedInteger('minted_days')->default(0)->comment('已产出天数');
            $table->unsignedInteger('days')->default(365)->comment('总产出天数');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('nfts');
    }
};
